*********************************
***  Trump paper - APPENDIX
*** Created: 31/10/2020
*** Last updated: 21/05/2021
clear all
set scheme plottig
 

	local user = 1		/* user 1 = sergi, user 2 = Anja */

	if `user' == 1 {			// input relevant file path as per your computer

		global		main "/Users/aneundorf/Dropbox/Project_Populism/BA project/Analysis/Trump_Replication files/"
		global 		graphs 			"${main}Graphs/"
		global 		results			"${main}Results/"
	}

cd "${main}"

**-----------------------------
* Appendix 1: Comparing sample characteristics with American National Election Study (ANES) data

use "Data/US_data_recoded.dta", clear

sum age
tab1 female educ_cat domicile ethnic religion


** ANES 2016 - Downloaded from https://electionstudies.org/data-center/2016-time-series-study/

use "Data/anes_timeseries_2016.dta", clear
svyset [pweight=V160101], strata(V160201f) psu(V160202f)

keep if V161001!=-1

* Born in US
tab V161316
keep if V161316==1

* Age
tab V161267
recode V161267 (-9=.)
sum V161267

* Gender
tab V161002

* education
tab V161270

recode V161270 (1/8=1 "Less than HS") (9/10=2 "HS")(11/16=3 "Degree")(95=.), gen(educ_cat)
tab educ_cat

* Ethnicity
tab1 V161309 V161310a 
tab V161310x
recode V161310x (-2=.) (1=1 "White") (2=2 "Black") (5=3 "Hispanic") (3/4=4 "Other") (6=4), gen(ethnic)
tab ethnic

* religion
tab V161244

* Domicile
tab V167534
recode V167534 (-8/-1=.) (1/2=1 "Rural") (3=2 "Suburban") (4=3 "Urban"), gen(domicile)
tab domicile



**-----------------------------
* Appendix 2: Balance test

use "Data/US_data_recoded.dta", clear

capture erase "${results}Results_appendix2.xls"
capture erase "${results}Results_appendix2.txt"
mlogit Group $controls_all income_linear i.partisan_cat , base(4)
		estimates store M0_balance
			outreg2  using "${results}Results_appendix2.xls", ///
			bracket bdec(3) sdec(3) append	


**-----------------------------
* Appendix 3: Coefficients of main models and robustness estimation strategy

use "Data/US_data_recoded.dta", clear

global controls_all female age01 educ2 educ3 dom2 dom3 dom4 ethnic2 ethnic3 ethnic4 relig3 relig2
global controls i.ethnic i.religion 

capture erase "${results}Results_appendix3.xls"
capture erase "${results}Results_appendix3.txt"

reg trump_vsbiden ib4.Group  $controls
		estimates store M1_vote
			outreg2  using "${results}Results_appendix3.xls", ///
			bracket bdec(3) sdec(3) append

reg trump_vsbiden ib4.Group  $controls_all
		estimates store M1_vote
			outreg2  using "${results}Results_appendix3.xls", ///
			bracket bdec(3) sdec(3) append

reg trump_feeling ib4.Group  $controls
		estimates store M1_trump
			outreg2  using "${results}Results_appendix3.xls", ///
			bracket bdec(3) sdec(3) append	

			
reg trump_feeling ib4.Group  $controls_all
		estimates store M1_trump
			outreg2  using "${results}Results_appendix3.xls", ///
			bracket bdec(3) sdec(3) append	

reg biden_feeling ib4.Group $controls
		estimates store M1_biden
			outreg2  using "${results}Results_appendix3.xls", ///
			bracket bdec(3) sdec(3) append	

reg biden_feeling ib4.Group $controls_all
		estimates store M1_biden
			outreg2  using "${results}Results_appendix3.xls", ///
			bracket bdec(3) sdec(3) append	
			
logit trump_vsbiden ib4.Group $controls
		estimates store M1_vote_logit
			outreg2  using "${results}Results_appendix3.xls", ///
			bracket bdec(3) sdec(3) append		

logit voteTrump ib4.Group $controls
		estimates store M1_vote2_logit
			outreg2  using "${results}Results_appendix3.xls", ///
			bracket bdec(3) sdec(3) append

reg trump_vsbiden ib4.Group $controls, cluster(qSTATE)
		estimates store M1_vote_se
			outreg2  using "${results}Results_appendix3.xls", ///
			bracket bdec(3) sdec(3) append


			
**-----------------------------
* Appendix 4: Additional results: Controlling for political preferences and populism
use "Data/US_data_recoded.dta", clear

global controls1 female age educ2 educ3 dom2 dom3 dom4 ethnic2 ethnic3 ethnic4 relig3 relig2
global politics2  ib2.partisan_cat immig01 spending01 populism01

reg trump_feeling ib4.Group $controls1 $politics2
		estimates store M1_trump2
		
reg biden_feeling ib4.Group $controls1 $politics2
		estimates store M1_biden2	
			
reg trump_vsbiden ib4.Group $controls1 $politics2
		estimates store M1_vote2

			
* Main effects: Coefplot
coefplot M1_vote2, bylabel(Vote: Trump over Biden) drop($controls1 _cons) xline(0) title("A. Outcome - Vote: Trump over Biden", size(medlarge)) xlabel(, labsize(medsmall)) ylabel(,labsize(medsmall)) name(vote2, replace)  xsize(7) ysize(9) 	

	
coefplot M1_trump2, bylabel(Therometer feeling: Trump) drop($controls1 _cons) xline(0) title("B. Therometer feeling: Trump", size(medlarge))  xlabel(-40(10)40, labsize(medsmall)) name(Trump2, replace)   xsize(7) ysize(9) ylabel(,labsize(medsmall))

coefplot M1_biden2, bylabel(Therometer feeling: Biden) drop($controls1 _cons) xline(0) title("C. Therometer feeling: Biden", size(medlarge)) ylabel(,labsize(medsmall))  xlabel(-40(10)40, labsize(medsmall)) name(Biden2, replace)  xsize(7) ysize(9) 


graph combine vote2 Trump2 Biden2 , title("Priming people on different aspects of the Coronavirus outbreak", size(large)) row(1) graphregion(fcolor(white) lc(black)) xsize(11) ysize(5) 
graph save  "${graphs}Appendix4.gph",  replace
graph export  "${graphs}Appendix4.pdf", as(pdf) replace


**-----------------------------
* Appendix 5.1: The conditional effects of the economy treatment on thermometer feelings by subjective unempl. risk and income

use "Data/US_data_recoded.dta", clear
global controls_all female age01 educ2 educ3 dom2 dom3 dom4 ethnic2 ethnic3 ethnic4 relig3 relig2


reg trump_feeling ib4.Group##c.unemp_prob $controls_all
margins, dydx(i.Group) at(unemp_prob=(1 2 3 4))
marginsplot, plot2opts(lc(none) mc(none)) plot3opts(lc(none) mc(none)) ci2opt(lc(none)) ci3opt(lc(none)) legend(off) yline(0) title("Trump feeling by unemployment risk", size(large)) ytitle("Marginal effect" "of economic treatment", size(medlarge)) xlabel(, labsize(medsmall)) ylabel(-40(20)40, labsize(medsmall)) xtitle("Unemployment risk (1=very; 4=none)", size(medium)) name(trump_unemp, replace)


reg biden_feeling ib4.Group##c.unemp_prob $controls_all
margins, dydx(i.Group) at(unemp_prob=(1 2 3 4))
marginsplot, plot2opts(lc(none) mc(none)) plot3opts(lc(none) mc(none)) ci2opt(lc(none)) ci3opt(lc(none)) legend(off) yline(0) title("Biden feeling by unemployment risk", size(large)) ytitle("Marginal effect" "of economic treatment", size(medlarge)) xlabel(, labsize(medsmall)) ylabel(-40(20)40, labsize(medsmall)) xtitle("Unemployment risk (1=very; 4=none)", size(medium)) name(biden_unemp, replace)


reg trump_feeling ib4.Group##c.income_linear $controls_all
margins, dydx(i.Group) at(income=(1(1)24))
marginsplot, plot2opts(lc(none) mc(none)) plot3opts(lc(none) mc(none)) ci2opt(lc(none)) ci3opt(lc(none)) legend(off) yline(0) title("Trump feeling by income", size(large)) ytitle("Marginal effect" "of economic treatment", size(medlarge)) xlabel(, labsize(medsmall)) ylabel(-40(20)40, labsize(medsmall)) xtitle("Income (1= <$15,000; 24= $250,000+)", size(medium)) name(trump_inc, replace)

reg biden_feeling ib4.Group##c.income_linear $controls_all
margins, dydx(i.Group) at(income=(1(1)24))
marginsplot, plot2opts(lc(none) mc(none)) plot3opts(lc(none) mc(none)) ci2opt(lc(none)) ci3opt(lc(none)) legend(off) yline(0) title("Biden feeling by income", size(large)) ytitle("Marginal effect" "of economic treatment", size(medlarge)) xlabel(, labsize(medsmall)) ylabel(-40(20)40, labsize(medsmall)) xtitle("Income (1= <$15,000; 24= $250,000+)", size(medium)) name(biden_inc, replace)



graph combine trump_unemp biden_unemp trump_inc biden_inc, row(2) graphregion(fcolor(white) lc(black)) xsize(9) ysize(6) 
graph save  "${graphs}Appendix5_1.gph",  replace
graph export  "${graphs}Appendix5_1.pdf", as(pdf) replace


**-----------------------------
* Appendix 5.1.1: The conditional effects of the economy treatment by income (binary - median split)

use "Data/US_data_recoded.dta", clear
global controls_all female age01 educ2 educ3 dom2 dom3 dom4 ethnic2 ethnic3 ethnic4 relig3 relig2


reg trump_vsbiden ib4.Group##i.income_binary $controls_all
margins, dydx(i.Group) at(income=(0 1))
marginsplot, horiz plot2opts(lc(none) mc(none)) plot3opts(lc(none) mc(none)) plot1opts(lc(none)) ci2opt(lc(none)) ci3opt(lc(none)) legend(off) xline(0)  xtitle("Marginal effect of economic treatment", size(large))  ylabel(-0.5(0.5)1.5 -0.5 " "  0 "Below $50,000" 0.5 " " 1 "$50,000 and above" 1.5 " ", noticks labsize(medlarge))  xlabel(-.5(.1).4, labsize(medium)) ytitle("", size(medium)) xsize(8) ysize(3)  title("Trump vote by income", size(vlarge)) name(vote_inc_binary, replace)


reg trump_feeling ib4.Group##c.income_binary $controls_all
margins, dydx(i.Group) at(income=(0 1))
 marginsplot, horiz plot2opts(lc(none) mc(none)) plot3opts(lc(none) mc(none)) plot1opts(lc(none)) ci2opt(lc(none)) ci3opt(lc(none)) legend(off) xline(0)  xtitle("Marginal effect of gov. management treatment", size(large))  ylabel(-0.5(0.5)1.5 -0.5 " "   0 "Below $50,000" 0.5 " " 1 "$50,000 and above" 1.5 " ", noticks labsize(medlarge))  xlabel(-40(10)40, labsize(medium)) ytitle("", size(medium)) xsize(8) ysize(3)  title("Trump feeling by income", size(vlarge)) name(trump_inc_binary, replace)

reg biden_feeling ib4.Group##c.income_binary $controls_all
margins, dydx(i.Group) at(income=(0 1))
 marginsplot, horiz plot2opts(lc(none) mc(none)) plot3opts(lc(none) mc(none)) plot1opts(lc(none)) ci2opt(lc(none)) ci3opt(lc(none)) legend(off) xline(0)  xtitle("Marginal effect of gov. management treatment", size(large))  ylabel(-0.5(0.5)1.5 -0.5 " "   0 "Below $50,000" 0.5 " " 1 "$50,000 and above" 1.5 " ", noticks labsize(medlarge))  xlabel(-40(10)40, labsize(medium)) ytitle("", size(medium)) xsize(8) ysize(3)  title("Biden feeling by income", size(vlarge)) name(biden_inc_binary, replace)

graph combine vote_inc_binary trump_inc_binary biden_inc_binary, row(3) graphregion(fcolor(white) lc(black)) xsize(6) ysize(9) 
graph save  "${graphs}Appendix5_1_1.gph",  replace
graph export  "${graphs}Appendix5_1_1.pdf", as(pdf) replace



**-----------------------------
* Appendix 5.2: The conditional effects of the government management treatment on thermometer feelings by age
use "Data/US_data_recoded.dta", clear
global controls2 female  i.educ_cat i.domicile i.ethnic i.religion

reg trump_feeling ib4.Group##c.age##c.age##c.age $controls2
margins, dydx(i.Group) at(age=(20(5)80))
marginsplot, yline(0) plot2opts(lc(black) mc(black)) ci2opt(lc(black)) plot3opts(lc(none) mc(none)) plot1opts(lc(none) mc(none)) ci1opt(lc(none)) ci3opt(lc(none)) legend(off) yline(0) ytitle("Marginal effect of gov. managment treatment", size(large)) xlabel(, labsize(medsmall)) ylabel(, labsize(medsmall)) xtitle("Age", size(medium)) title("Trump feeling by age", size(large)) name(Trump_age, replace)

reg biden_feeling ib4.Group##c.age##c.age##c.age $controls2
margins, dydx(i.Group) at(age=(20(5)80))
marginsplot, yline(0) plot2opts(lc(black) mc(black)) ci2opt(lc(black)) plot3opts(lc(none) mc(none)) plot1opts(lc(none) mc(none)) ci1opt(lc(none)) ci3opt(lc(none)) legend(off) yline(0) ytitle("Marginal effect of gov. managment treatment", size(large)) xlabel(, labsize(medsmall)) ylabel(, labsize(medsmall)) xtitle("Age", size(medium)) title("Biden feeling by age", size(large)) name(Biden_age, replace)

graph combine Trump_age Biden_age , row(1) graphregion(fcolor(white) lc(black)) xsize(9) ysize(5) 
graph save  "${graphs}Appendix5_2.gph",  replace
graph export  "${graphs}Appendix5_2.pdf", as(pdf) replace


**-----------------------------
* Appendix 5.2.1: The conditional effects of the economy treatment by age (BINARY)
use "Data/US_data_recoded.dta", clear
global controls2 female  i.educ_cat i.domicile i.ethnic i.religion

** Binary age
reg trump_feeling ib4.Group##i.age55 $controls2
margins, dydx(i.Group) at(age55=(0 1))
marginsplot, horiz plot2opts(lc(none) mc(black)) ci2opt(lc(black)) plot3opts(lc(none) mc(none)) plot1opts(lc(none) mc(none)) ci1opt(lc(none)) ci3opt(lc(none)) legend(off) xline(0)  xtitle("Marginal effect of gov. management treatment", size(large))  ylabel(-0.5(0.5)1.5 -0.5 " "  0 "Below 55" 0.5 " " 1 "55 and older" 1.5 " ", noticks labsize(medlarge))  xlabel(-40(10)40, labsize(medium)) ytitle("", size(medium)) xsize(8) ysize(3)  title("Trump feeling by age", size(vlarge) ) name(Trump_age_binary, replace)

reg biden_feeling ib4.Group##i.age55 $controls2
margins, dydx(i.Group) at(age55=(0 1))
marginsplot, horiz plot2opts(lc(none) mc(black)) ci2opt(lc(black)) plot3opts(lc(none) mc(none)) plot1opts(lc(none) mc(none)) ci1opt(lc(none)) ci3opt(lc(none)) legend(off) xline(0)  xtitle("Marginal effect of gov. management treatment", size(large))  ylabel(-0.5(0.5)1.5 -0.5 " "  0 "Below 55" 0.5 " " 1 "55 and older" 1.5 " ", noticks labsize(medlarge))  xlabel(-40(10)40, labsize(medium)) ytitle("", size(medium)) xsize(8) ysize(3)  title("Biden feeling by age", size(vlarge)) name(Biden_age_binary, replace)

reg trump_vsbiden ib4.Group##i.age55 $controls2
margins, dydx(i.Group) at(age55=(0 1))
marginsplot, horiz plot2opts(lc(none) mc(black)) ci2opt(lc(black)) plot3opts(lc(none) mc(none)) plot1opts(lc(none) mc(none)) ci1opt(lc(none)) ci3opt(lc(none))  legend(off) xline(0)  xtitle("Marginal effect of gov. management treatment", size(large))  ylabel(-0.5(0.5)1.5 -0.5 " "  0 "Below 55" 0.5 " " 1 "55 and older" 1.5 " ", noticks labsize(medlarge))  xlabel(-.5(.1).4, labsize(medium)) ytitle("", size(medium)) xsize(8) ysize(3)  title("Trump vote by age", size(vlarge)) name(vote_age_binary, replace) 


graph combine vote_age_binary Trump_age_binary Biden_age_binary, row(3) graphregion(fcolor(white) lc(black)) xsize(6) ysize(9) 
graph save  "${graphs}Appendix5_2_1.gph",  replace
graph export  "${graphs}Appendix5_2_1.pdf", as(pdf) replace

**-----------------------------
* Appendix 5.3: The conditional effects of the immigration treatment on thermometer feelings
use "Data/US_data_recoded.dta", clear
global controls_all female age01 educ2 educ3 dom2 dom3 dom4 ethnic2 ethnic3 ethnic4 relig3 relig2


reg trump_feeling ib4.Group##c.immig_pref $controls_all
margins, dydx(i.Group) at(immig_pref=(1(1)5))
marginsplot, yline(0) plot3opts(lc(black) mc(black)) ci3opt(lc(black)) plot1opts(lc(none) mc(none)) plot2opts(lc(none) mc(none)) ci1opt(lc(none)) ci2opt(lc(none)) legend(off) yline(0) ytitle("Marginal effect of immigration treatment", size(medlarge)) xlabel(, labsize(medsmall)) ylabel(-40(10)40, labsize(medsmall)) xtitle("Immigration preferences (1=open; 5=restrict)", size(medlarge)) title("Trump feeling by immigration pref.", size(large)) graphregion(fcolor(white) lc(none)) name(trump_imm, replace)

reg biden_feeling ib4.Group##c.immig_pref $controls_all
margins, dydx(i.Group) at(immig_pref=(1(1)5))
marginsplot, yline(0) plot3opts(lc(black) mc(black)) ci3opt(lc(black)) plot1opts(lc(none) mc(none)) plot2opts(lc(none) mc(none)) ci1opt(lc(none)) ci2opt(lc(none)) legend(off) yline(0) ytitle("Marginal effect of immigration treatment", size(medlarge)) xlabel(, labsize(medsmall)) ylabel(-40(10)40, labsize(medsmall)) xtitle("Immigration preferences (1=open; 5=restrict)", size(medlarge)) title("Biden feeling by immigration pref.", size(large)) graphregion(fcolor(white) lc(none)) name(biden_imm, replace)

graph combine trump_imm biden_imm , row(1) graphregion(fcolor(white) lc(black)) xsize(9) ysize(5) 
graph save  "${graphs}Appendix5_3.gph",  replace
graph export  "${graphs}Appendix5_3.pdf", as(pdf) replace


**-----------------------------
* Appendix 5.4: The conditional effects of partisanship across all treatments on thermometer feelings
use "Data/US_data_recoded.dta", clear
global controls_all female age01 educ2 educ3 dom2 dom3 dom4 ethnic2 ethnic3 ethnic4 relig3 relig2


reg trump_feeling ib4.Group##ib2.partisan_cat $controls_all
margins, dydx(i.Group) at(partisan_cat=(1(1)3))

marginsplot, horiz xline(0) plot1opts(lc(none) mc(black)) ci1opt(lc(black)) plot2opts(lc(none) mc(none)) plot3opts(lc(none) mc(none)) ci2opt(lc(none)) ci3opt(lc(none)) legend(off) xline(0) xtitle("Marginal effect of economy treatment", size(large)) ylabel(, labsize(medlarge)) xlabel(-40(10)40, labsize(medium)) ytitle("Partisanship", size(large)) title("A. Treatment: Economy", size(vlarge)) name(pid_econ2, replace) xsize(8) ysize(3)

marginsplot, horiz plot2opts(lc(none) mc(black)) ci2opt(lc(black)) plot1opts(lc(none) mc(none)) plot3opts(lc(none) mc(none)) ci1opt(lc(none)) ci3opt(lc(none)) legend(off) xline(0) xtitle("Marginal effect of gov. management treatment", size(large)) ylabel(, labsize(medlarge)) xlabel(-40(10)40, labsize(medium)) ytitle("Partisanship", size(large)) title("B. Treatment: Gov. management", size(vlarge)) name(pid_gov2, replace) xsize(8) ysize(3)


marginsplot, horiz plot3opts(lc(none) mc(black)) ci3opt(lc(black)) plot2opts(lc(none) mc(none)) plot1opts(lc(none) mc(none)) ci2opt(lc(none)) ci1opt(lc(none)) legend(off) xline(0) xtitle("Marginal effect of China virus treatment", size(large)) ylabel(, labsize(medlarge)) xlabel(-40(10)40, labsize(medium)) ytitle("Partisanship", size(large)) title("C. Treatment: China virus", size(vlarge)) name(pid_immig2, replace) xsize(8) ysize(3)

graph combine pid_econ2  pid_gov2 pid_immig2, row(3) graphregion(fcolor(white) lc(black)) xsize(6) ysize(9) name(trump_pid, replace) title("Trump feeling by partisanship", size(large))



reg biden_feeling ib4.Group##ib2.partisan_cat $controls_all
margins, dydx(i.Group) at(partisan_cat=(1(1)3))

marginsplot, horiz xline(0) plot1opts(lc(none) mc(black)) ci1opt(lc(black)) plot2opts(lc(none) mc(none)) plot3opts(lc(none) mc(none)) ci2opt(lc(none)) ci3opt(lc(none)) legend(off) xline(0) xtitle("Marginal effect of economy treatment", size(large)) ylabel(, labsize(medlarge)) xlabel(-40(10)40, labsize(medium)) ytitle("Partisanship", size(large)) title("A. Treatment: Economy", size(vlarge)) name(pid_econ2, replace) xsize(8) ysize(3)

marginsplot, horiz plot2opts(lc(none) mc(black)) ci2opt(lc(black)) plot1opts(lc(none) mc(none)) plot3opts(lc(none) mc(none)) ci1opt(lc(none)) ci3opt(lc(none)) legend(off) xline(0) xtitle("Marginal effect of gov. management treatment", size(large)) ylabel(, labsize(medlarge)) xlabel(-40(10)40, labsize(medium)) ytitle("Partisanship", size(large)) title("B. Treatment: Gov. management", size(vlarge)) name(pid_gov2, replace) xsize(8) ysize(3)


marginsplot, horiz plot3opts(lc(none) mc(black)) ci3opt(lc(black)) plot2opts(lc(none) mc(none)) plot1opts(lc(none) mc(none)) ci2opt(lc(none)) ci1opt(lc(none)) legend(off) xline(0) xtitle("Marginal effect of China virus treatment", size(large)) ylabel(, labsize(medlarge)) xlabel(-40(10)40, labsize(medium)) ytitle("Partisanship", size(large)) title("C. Treatment: China virus", size(vlarge)) name(pid_immig2, replace) xsize(8) ysize(3)

graph combine pid_econ2  pid_gov2 pid_immig2, row(3) graphregion(fcolor(white) lc(black)) xsize(6) ysize(9) name(biden_pid, replace) title("Biden feeling by partisanship", size(large))

graph combine trump_pid biden_pid, row(1) graphregion(fcolor(white) lc(none)) xsize(9) ysize(6) 
graph save  "${graphs}Appendix5_4.gph",  replace
graph export  "${graphs}Appendix5_4.pdf", as(pdf) replace



**-----------------------------
* Appendix 6.5: Manipulation check: No signficant differences to mediators when exposed to treatments
use "Data/US_data_recoded.dta", clear
global controls_all female age01 educ2 educ3 dom2 dom3 dom4 ethnic2 ethnic3 ethnic4 relig3 relig2

capture erase "${results}Results_Appendix6_5.xls"
capture erase "${results}Results_Appendix6_5.txt"

reg trump_vsbiden populism01  $controls_all
		estimates store M_vote
			outreg2  using "${results}Results_Appendix6_5.xls", ///
			bracket bdec(3) sdec(3) append

reg trump_feeling populism01  $controls_all
		estimates store M_trump
			outreg2  using "${results}Results_Appendix6_5.xls", ///
			bracket bdec(3) sdec(3) append	

reg biden_feeling populism01  $controls_all
		estimates store M_trump
			outreg2  using "${results}Results_Appendix6_5.xls", ///
			bracket bdec(3) sdec(3) append	
			
			
reg trump_vsbiden spending01  $controls_all
		estimates store M2_vote
			outreg2  using "${results}Results_Appendix6_5.xls", ///
			bracket bdec(3) sdec(3) append

reg trump_feeling spending01  $controls_all
		estimates store M2_trump
			outreg2  using "${results}Results_Appendix6_5.xls", ///
			bracket bdec(3) sdec(3) append	

reg biden_feeling spending01  $controls_all
		estimates store M2_trump
			outreg2  using "${results}Results_Appendix6_5.xls", ///
			bracket bdec(3) sdec(3) append
	
			
**-----------------------------
* Appendix 7.1: Predicted vote share for Trump (over Biden) by treatment group
use "Data/US_data_recoded.dta", clear
global controls_all female age01 educ2 educ3 dom2 dom3 dom4 ethnic2 ethnic3 ethnic4 relig3 relig2

* Main effects
reg trump_vsbiden ib4.Group $controls_all
margins, at(Group=(1 2 3 4))
marginsplot, horiz plotopts(lc(none))  xline(0.5)  xtitle("Predicted vote share for Trump over Biden", size(medium)) xlabel(, labsize(medsmall)) xlabel(0.2(0.1).8, labsize(medsmall)) ytitle("Treatment Group", size(medlarge)) title("" ) name(pred_all, replace) xsize(7) ysize(5) graphregion(fcolor(white) lc(black)) ylabel(0(1)5 0 " "  1 "T1 - Economy" 3"T3 - Chinese virus" 2"T2 - Gov. managment" 4"Control" 5 " ", noticks labsize(medsmall))
graph save  "${graphs}Appendix7_1.gph",  replace
graph export  "${graphs}Appendix7_1.pdf", as(pdf) replace

**-----------------------------
* Appendix 7.2: Predicted vote share for Trump (over Biden) by unemployment risk (A) and age (B) and treatment group
use "Data/US_data_recoded.dta", clear
global controls_all female age01 educ2 educ3 dom2 dom3 dom4 ethnic2 ethnic3 ethnic4 relig3 relig2
global controls2 female  i.educ_cat i.domicile i.ethnic i.religion

* Unemployment
reg trump_vsbiden ib4.Group##c.unemp_prob $controls_all
margins,  at(unemp_prob=(1 2 3 4) Group=(1 4))
marginsplot, yline(0.5)  ytitle("Predicted vote share for Trump over Biden", size(medium)) xlabel(, labsize(medsmall)) ylabel(0(0.1)1, labsize(medsmall)) xtitle("Unemployment risk (1=very; 4=none)", size(medium)) title("A. Unemployment risk and the economic crisis", size(medlarge))	legend(lab(3 "Treatment: Econonomic crisis of Covid-19") lab(4 "Control group: No mention of Covid-19") size(medsmall)  row(2) region(lcolor(white)) pos(1) order(3 4) ring(0)) graphregion(fcolor(white) ) name(unemp_pred, replace)
* Age
reg trump_vsbiden ib4.Group##c.age##c.age##c.age $controls2
margins, at(age=(20(5)80) Group=(2 4))
marginsplot, yline(0.5)  ytitle("Predicted vote share for Trump over Biden", size(medium)) xlabel(, labsize(medsmall)) ylabel(0(0.1)1, labsize(medsmall)) xtitle("Age", size(medium)) title("B. Age and the managment of the crisis" , size(medlarge))	legend(lab(3 "Treatment: Gov. management of Covid-19") lab(4 "Control group: No mention of Covid-19") size(medsmall)  row(2) region(lcolor(white)) pos(1) order(3 4) ring(0)) graphregion(fcolor(white)) name(age_pred, replace)

** Create graphs
graph combine unemp_pred  age_pred, row(1) graphregion(fcolor(white) lc(black)) xsize(9) ysize(5) 
graph save  "${graphs}Appendix7_2.gph",  replace
graph export  "${graphs}Appendix7_2.pdf", as(pdf) replace



**-----------------------------
* Appendix 8: Impact of treatments on potentially endogenous moderating and mediating variable

use "Data/US_data_recoded.dta", clear
global controls_all female age01 educ2 educ3 dom2 dom3 dom4 ethnic2 ethnic3 ethnic4 relig3 relig2

bys Group: sum unemp_prob populism spending_unemp immig_pref

reg unemp_prob ib4.Group $controls_all
coefplot, bylabel(Vote: Trump over Biden) drop($controls_all _cons) xline(0) title("A. Unemployment risk", size(medlarge)) xlabel(, labsize(medsmall)) ylabel(,labsize(medsmall)) name(unemp, replace)  xsize(7) ysize(9) 


reg populism ib4.Group $controls_all
coefplot, bylabel(Vote: Trump over Biden) drop($controls_all _cons) xline(0) title("C. Populism", size(medlarge)) xlabel(, labsize(medsmall)) ylabel(,labsize(medsmall)) name(popl, replace)  xsize(7) ysize(9) 


reg spending_unemp ib4.Group $controls_all
coefplot, bylabel(Vote: Trump over Biden) drop($controls_all _cons) xline(0) title("B. Spending preferences", size(medlarge)) xlabel(, labsize(medsmall)) ylabel(,labsize(medsmall)) name(spend, replace)  xsize(7) ysize(9) 


reg immig_pref ib4.Group $controls_all
coefplot, bylabel(Vote: Trump over Biden) drop($controls_all _cons) xline(0) title("D. Immigration preferences", size(medlarge)) xlabel(, labsize(medsmall)) ylabel(,labsize(medsmall)) name(immig, replace)  xsize(7) ysize(9) 

graph combine unemp spend popl immig, graphregion(fcolor(white) lc(black)) 
graph save  "${graphs}Appendix8.gph",  replace
graph export  "${graphs}Appendix8.pdf", as(pdf) replace
